"""


"""
import logging
import redis


class Config(object):
    DEBUG = True
    SECRET_KEY = "$%^%&*^*&^(*^&*"
    # 对mysql数据库进行配置
    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@127.0.0.1:3306/info_gz10"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # 对redis数据库进行配置
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379

    # 对session进行配置
    SESSION_TYPE = "redis"
    SESSION_USE_SIGNER = True
    SESSION_KEY_PREFIX = "Session:"
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    PERMANENT_SESSION_LIFETIME = 3600 * 24 * 2


# 开发模式
class DevelopmentConfig(Config):
    DEBUG = True
    LOG_LV = logging.DEBUG


# 生产模式(线上)
class ProductionConfig(Config):
    DEBUG = False
    LOG_LV = logging.ERROR


config_dict = {
    "develop": DevelopmentConfig,
    "product": ProductionConfig
}